local M = {
  "nvim-tree/nvim-tree.lua",
  dependencies = "nvim-tree/nvim-web-devicons"
}

M.config = function()
  local nvimtree = require("nvim-tree")

  local wk = require "which-key"
  wk.register {
    [",t"] = { "<cmd>NvimTreeFindFileToggle<CR>", "NvimTreeToggle" },
    ["<leader>ee"] = { "<cmd>NvimTreeToggle<CR>", "NvimTreeToggle" },
    ["<leader>ef"] = { "<cmd>NvimTreeFindFileToggle<CR>", "NvimTreeFindFile" },
    ["<leader>er"] = { "<cmd>NvimTreeRefresh<CR>", "NvimTreeRefresh" },
  }

  vim.g.loaded_newtrw = 1
  vim.g.loaded_newtrwPlugin = 1

  nvimtree.setup({})
end

return M
